package com.zlp.clazz;

import java.sql.Driver;
import java.sql.DriverManager;
import java.util.Enumeration;

public class ClazzLoaderDemo_4 {

    /**
     * 测试打破双亲委派机制
     * @param args
     */
    public static void main(String[] args) {
        Enumeration<Driver> drivers = DriverManager.getDrivers();
        System.out.println(Driver.class.getClassLoader());
        Driver driver;
        while (drivers.hasMoreElements())
        {
            driver = drivers.nextElement();
            System.out.println(driver.getClass() + "------" + driver.getClass().getClassLoader());
        }
        System.out.println(DriverManager.class.getClassLoader());
    }
}
